
public class CompoundMission extends Mission {
	
	private Task[] subtasks;
	
	public CompoundMission(String title, Task[] subtasks) {
		super(title);
		this.subtasks = subtasks;
	}
	
	public double cost(){
		double ans = 0;
		for (int i = 0 ; i < subtasks.length  ; i ++){
			ans = ans + ((Mission)subtasks[i]).cost();
		}
		return ans;
	}
	
	protected  String description(){
		String ans = "";
		for (int i = 0 ; i < subtasks.length  ; i ++){
			ans = ans + ((Task)subtasks[i]).report();
		}
		return ans;
	}
	
	

}
